Skip to content

Fill Reshape CUDA operator opset gap from 23 to 25#27742

Merged
tianleiwu merged 5 commits intomainfrom
copilot/update-reshape-cuda-operator
May 6, 2026
Merged

Fill Reshape CUDA operator opset gap from 23 to 25#27742
tianleiwu merged 5 commits intomainfrom
copilot/update-reshape-cuda-operator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

Description

Extends the Reshape CUDA kernel registration from opset 23 to opset 25, following the same pattern used in #27728.

  • reshape.cc: Cap existing non-versioned opset 23 kernel → versioned (23, 24); add new non-versioned kernel at opset 25
  • cuda_execution_provider.cc: Update forward declaration and BuildKernelCreateInfo for versioned (23, 24); add opset 25 entries
  • docs/OperatorKernels.md: Update Reshape CUDA EP entry from 23+ to 25+ and add [23, 24] versioned range row

No functional changes to the kernel itself — the opset 25 schema is backward-compatible with opset 23.

Motivation and Context

Reshape is listed as a P1 gap in #27729 (CUDA max opset 23, ONNX latest opset 25). Models exported at opset 25 would fail to find a matching Reshape kernel on the CUDA EP.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tianleiwu
Copy link
Copy Markdown
Contributor

tianleiwu commented Mar 18, 2026

@copilot, please update docs/OperatorKernels.md, and merge latest main branch to this branch.

Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot, please update docs/OperatorKernels.md, and merge latest main branch to this branch.

Updated in 2c7dfd5 — changed Reshape CUDA EP entry from 23+ to 25+ and added a [23, 24] versioned range row.

Copilot AI requested a review from tianleiwu March 18, 2026 23:10
@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Extends CUDA EP support for the ONNX Reshape operator through opset 25 by splitting the existing opset-23 registration into a versioned (23–24) kernel and adding a new “since 25” kernel entry, matching the pattern used in #27728.

Changes:

  • Update Reshape CUDA kernel registration to cover opsets 23–24 (versioned) and 25+ (new since-version registration).
  • Update CUDA EP kernel declaration/registry entries to include opset 25 and the new versioned (23–24) entry.
  • Update documentation to reflect the new CUDA EP opset coverage for Reshape.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
onnxruntime/core/providers/cuda/tensor/reshape.cc Moves existing opset-23 registration to versioned (23–24) and adds new opset-25 registration.
onnxruntime/core/providers/cuda/cuda_execution_provider.cc Updates kernel class forward decls and registry entries to include versioned (23–24) and opset-25 Reshape.
docs/OperatorKernels.md Updates CUDA EP opset coverage doc table for Reshape to show 25+ and [23, 24].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread onnxruntime/core/providers/cuda/cuda_execution_provider.cc Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@tianleiwu tianleiwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Clean, correct mechanical change. The opset 23 non-versioned Reshape kernel registration is correctly split into a versioned 23–24 registration plus a new since-25 registration. Both versions use the identical Reshape class and type constraints, which is appropriate since the ONNX opset 25 Reshape spec has no semantic changes over opset 24.

Positives:

  • Forward declarations and BuildKernelCreateInfo entries are correctly updated with proper alphabetical placement among opset 25 operators.
  • Kernel registrations in reshape.cc follow the project convention (newest version first).
  • Type constraints (AllFixedSizeTensorTypesIRv9) are consistent with other CUDA Reshape opset registrations and with the CPU EP approach.
  • Documentation in OperatorKernels.md is correctly updated.

No concerns found. The version ranges are non-overlapping and complete, no behavioral changes are needed, and the pattern matches established practice for other operators already registered at opset 25 (Scan, Shape, Size, Flatten, etc.).

@tianleiwu tianleiwu enabled auto-merge (squash) May 5, 2026 23:02
Copy link
Copy Markdown
Contributor

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's gooo

@tianleiwu tianleiwu merged commit 8aec1a5 into main May 6, 2026
89 checks passed
@tianleiwu tianleiwu deleted the copilot/update-reshape-cuda-operator branch May 6, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants